﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using Hartley.ApplicationLogic;
using Hartley.DTOs;



namespace WebApplication1
{
    public partial class viewNews : System.Web.UI.Page
    {
        AdminAL adminAL = new AdminAL();
        protected void Page_Load(object sender, EventArgs e)
        {
            string url = Request.QueryString.ToString();
            //string newsId = url.ToString().Substring(url.ToString().LastIndexOf("?"));
            string newsId = url;
            List<NewsItemDTO> news = adminAL.GetNewsById(new Guid(newsId)).ToList();
            txtNewsViewHeading.Text = news.SingleOrDefault().Title.ToString();
            txtNewsViewBody.Text = news.SingleOrDefault().Description.ToString();

           
        }
    }
}
